﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Drawing;

namespace VisualTrajectory
{
    public class Trajectory
    {
        private List<PointF> m_PointList = new List<PointF>();
        private string m_strName;

        public Trajectory()
        {
        }

        public void SetName(string name)
        {
            m_strName = name;
        }

        public string GetName()
        {
            return m_strName;
        }

        public int GetPointCount()
        {
            return m_PointList.Count;
        }

        public PointF GetPoint(int nIndex)
        {
            return m_PointList[nIndex];
        }

        public void AddPoint(PointF p)
        {
            m_PointList.Add(p);
        }

        public void SetPoint(int nIndex, PointF p)
        {
            m_PointList[nIndex] = p;
        }

        public void WriteToStream(StreamWriter writer)
        {
            for (int i = 0; i < m_PointList.Count; i++)
            {
                writer.WriteLine(m_strName + "\t" + m_PointList[i].X + "\t" + m_PointList[i].Y + "\t");
            }
        }

    }
}
